package com.example.productdataserviceprovider.service.hutool;

import cn.hutool.core.swing.ClipboardUtil;
import cn.hutool.core.util.ReflectUtil;
import cn.hutool.core.util.XmlUtil;

import java.io.File;
import java.io.IOException;

public class TestXml {
    public static void main(String[] args) {
        Book book=new Book();
        book.setBookName("小猪peiqi");
        book.setPrice("100");
        book.setPublish("教育出版社");
        try {
            XmlUtil.writeObjectAsXml(new File("D:/jd/hutool/book.xml"),book);
        } catch (IOException e) {
            e.printStackTrace();
        }
        ReflectUtil.invoke(book,"setPrice","200");
        System.out.println(book);
        System.out.println(ClipboardUtil.getStr());
    }
}
